<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" type="image/x-icon" href="<?php echo Yii::app()->request->baseUrl; ?>/img/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!-- Styles -->
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap-responsive.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap-overrides.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/js/plugins/msgGrowl/css/msgGrowl.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/slate.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/slate-responsive.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/pages/calendar.css" rel="stylesheet"/>
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/components/error.css" rel="stylesheet"/>
<!-- Javascript -->
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-ui-1.8.21.custom.min.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.ui.touch-punch.min.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/bootstrap.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/plugins/fullcalendar/fullcalendar.min.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/Slate.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/plugins/msgGrowl/js/msgGrowl.js"></script>

<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->

</head>

<body>
  	
<div id="header">
	
	<div class="container">			
		
		<h1><a href="cpanel.php"><?php echo CHtml::encode(Yii::app()->name); ?></a></h1>			
		
		<div id="info">				
			
			<a href="javascript:;" id="info-trigger">
				<i class="icon-cog"></i>
			</a>
			<div id="info-menu">
				<div class="info-details">
					<h4>Welcome back, <?php echo Yii::app()->user->fullname?>.</h4>
					<p>
						Logged in as <?php echo Yii::app()->user->role;?>.
					</p>
				</div> <!-- /.info-details -->
				<div class="info-avatar">
					<img src="img/avatar.jpg" alt="avatar"/>
					
				</div> <!-- /.info-avatar -->
				
			</div> <!-- /#info-menu -->
			
		</div> <!-- /#info -->
		
	</div> <!-- /.container -->

</div> <!-- /#header -->


<div id="nav">
		
	<div class="container">
		
		<a href="javascript:;" class="btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
        	<i class="icon-reorder"></i>
      	</a>
		
		<div class="nav-collapse">
			
			<?php $this->widget('zii.widgets.CMenu',array(
				'items'=>array(
					array('label'=>'<i class="icon-home"></i>Home', 'url'=>array('/site/index'),'linkOptions'=>array('encode'=>false)),
					array('label'=>'<i class="icon-film"></i>Film Manager', 'url'=>array('#'),
						'active'=>(
							Yii::app()->controller->id=='film' || 
							Yii::app()->controller->id=='category'|| 
							Yii::app()->controller->id=='type' || 
							Yii::app()->controller->id=='country' ||
							Yii::app()->controller->id=='episode' ||
							Yii::app()->controller->id=='link'
						),
						'itemOptions'=>array(
							'class'=>'dropdown'
						),
						'linkOptions'=>array(
							'class'=>'dropdown-toggle',
							'data-toggle'=>'dropdown',
						),
						'items'=>array(
							array('label'=>'List Film','url'=>array('/film/admin')),
							array('label'=>'Create Film','url'=>array('/film/create')),
							array('label'=>'Category','url'=>array('/category/admin')),
							array('label'=>'Types','url'=>array('/type/admin')),
							array('label'=>'Country','url'=>array('/country/admin')),
						),
					),
					array('label'=>'<i class="icon-play-circle"></i>Clip Manager', 'url'=>array('#'),
						'active'=>(
							Yii::app()->controller->id=='clip' || 
							Yii::app()->controller->id=='clipcategory'
						),
						'itemOptions'=>array(
							'class'=>'dropdown'
						),
						'linkOptions'=>array(
							'class'=>'dropdown-toggle',
							'data-toggle'=>'dropdown',
						),
						'items'=>array(
							array('label'=>'List Clips','url'=>array('/clip/admin')),
							array('label'=>'Create Clip','url'=>array('/clip/create')),
							array('label'=>'Clip Category','url'=>array('/clipcategory/admin')),
						),
					),
					array('label'=>'<i class="icon-facetime-video"></i>Tivi Manager', 'url'=>array('/tv/admin')),
					array('label'=>'<i class="icon-user-md"></i>Member Manager', 'url'=>array('/member/admin')),
					array('label'=>'<i class="icon-signin"></i>Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
					array('label'=>'<i class="icon-signout"></i>Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
// 					array('label'=>'<i class="icon-external-link"></i>', 'url'=>Yii::app()->request->baseUrl,'linkOptions'=>array('target'=>'_blank')),
				),
				'encodeLabel'=>false,
				'htmlOptions'=>array('class'=>'nav'),
				'submenuHtmlOptions'=>array('class'=>'dropdown-menu'),
			)); ?>
			
			<ul class="nav pull-right">
		
				<li class="">
					<form class="navbar-search pull-left">
						<input type="text" class="search-query" placeholder="Search">
						<button class="search-btn"><i class="icon-search"></i></button>
					</form>	    				
				</li>
				
			</ul>
			
		</div> <!-- /.nav-collapse -->
		
	</div> <!-- /.container -->
	
</div> <!-- /#nav -->


<div id="content">
		
	<div class="container">
		<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
				'links'=>$this->breadcrumbs,
			)); ?><!-- breadcrumbs -->
		<?php endif?>
		<?php echo $content; ?>
	</div> <!-- /.container -->
	
</div> <!-- /#content -->

<div id="footer">	
		
	<div class="container">
		
		&copy; 2012 TrungNV, all rights reserved.
		
	</div> <!-- /.container -->		
	
</div> <!-- /#footer -->
<script type="text/javascript">
	<?php
	    foreach(Yii::app()->user->getFlashes() as $key => $message) {
	        echo '$.msgGrowl ({'.
			'type:"'.$key.'"'.
			',title:"'.$key.'"'.
			',text:"'.$message.'"'.
			'});';
	    }
	?>
</script>
</body>
</html>